package org.gas.barapraja.handler;

import com.logica.smpp.pdu.BindRequest;
import com.logica.smpp.pdu.SubmitMultiSM;
import com.logica.smpp.pdu.SubmitSM;

/**
 * Interface used for handling incoming request such as:
 * <li>
 * logger for signed in account
 * </li>
 * <li>
 * composing message objects and
 * saving to database
 * </li>
 * @author gilang
 * @see {@link org.gas.barapraja.handler.RequestHandlerAdapter}
 */
public interface RequestHandler {
	
	/**
	 * Handling and validate BindRequest type requests
	 * @param request the bind request to handle
	 * @return handled validation request flag
	 * @see {@link org.gas.barapraja.handler.validator.RequestValidator}
	 * @see {@link org.gas.barapraja.handler.BindRequestHandler}
	 */
	int handleRequest(BindRequest request);
	
	/**
	 * Handling and validate SubmitSM type requests
	 * @param request the submitSM to handle
	 * @return handled validation request flag
	 * @see {@link org.gas.barapraja.handler.validator.RequestValidator#validate(com.logica.smpp.pdu.Request)}
	 * @see {@link org.gas.barapraja.handler.SingleMsgHandler}
	 */
	int handleRequest(SubmitSM submitSM);
	
	/**
	 * Handling and validate SubmitMultiSM type requests
	 * @param request the submitMultiSM to handle
	 * @return handled validation request flag
	 * @see {@link org.gas.barapraja.handler.validator.RequestValidator#validate(com.logica.smpp.pdu.Request)}
	 * @see {@link org.gas.barapraja.handler.MultiMsgHandler}
	 */
	int handleRequest(SubmitMultiSM multiSM);
}
